package com.fanjun.learning.multithread.ATM;

/**
 * Created by memedai on 2016/10/13.
 */
public class ATM {
    private volatile double account;

    public ATM(double account) {
        this.account = account;
    }

    public  void deposit(){
//        synchronized(this){
            account++;
            System.out.println("account plus 1,account is:" + account);
//        }
    }

    public void withdraw(){
//        synchronized(this){
            account--;
            System.out.println("account minus 1,account is:" + account);
//        }
    }

    public double getAccount() {
        return account;
    }
}
